import QtQuick 1.1
import com.nokia.meego 1.0


Rectangle {
    id: titleTextBackground

    property alias text: titletext.text
    property alias image: imgTitle.source
    property alias busy: titleBusy.running

    width: parent.width
    height: mytheme.pageTitleAreaHeight
    x: 0
    y: 0
    z: 1
    //color: theme.pageTitleAreaColor

    gradient: Gradient {
        GradientStop { position: 0.0; color: "darkblue" }
        GradientStop { position: 0.5; color: "blue" }
        GradientStop { position: 1; color: "darkblue" }
    }

    Item{
        id: titleItem
        anchors.fill: parent

        Image {
            id: imgTitle
            anchors.verticalCenter: parent.verticalCenter
            anchors.left: parent.left
            anchors.leftMargin: 10
            source: ""
            height: mytheme.pageTitleAreaHeight - 8
            width: mytheme.pageTitleAreaHeight - 8
            smooth: true
            visible: imgTitle.source != ""
        }

        Label {
            id: titletext
            anchors.left: imgTitle.right
            anchors.leftMargin: 10
            anchors.verticalCenter: parent.verticalCenter
            x: 2 * mytheme.defaultMargin

            font.family: mytheme.pageTitleFontFamily
            font.pixelSize: mytheme.pageTitleFontSize
            color: mytheme.pageTitleFontColor
            visible: text != ""
        }

        BusyIndicator {
            id: titleBusy
            anchors.verticalCenter: parent.verticalCenter
            anchors.right: parent.right
            anchors.rightMargin: 10
            running: false
            visible: titleBusy.running
            platformStyle: BusyIndicatorStyle {
                spinnerFrames: "image://theme/spinner"+"inverted"
            }
        }
    }
} //Rectangle - title
